3.216 \(\int \frac{\cot ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=115 \[ \frac{b^3 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 f (a-b)}+\frac{\left (a^2+a b+b^2\right ) \log (\tan (e+f x))}{a^3 f}+\frac{(a+b) \cot ^2(e+f x)}{2 a^2 f}+\frac{\log (\cos (e+f x))}{f (a-b)}-\frac{\cot ^4(e+f x)}{4 a f} \]

[Out]

((a + b)*Cot[e + f*x]^2)/(2*a^2*f) - Cot[e + f*x]^4/(4*a*f) + Log[Cos[e + f*x]]/((a - b)*f) + ((a^2 + a*b + b^
2)*Log[Tan[e + f*x]])/(a^3*f) + (b^3*Log[a + b*Tan[e + f*x]^2])/(2*a^3*(a - b)*f)

________________________________________________________________________________________

Rubi [A]  time = 0.137124, antiderivative size = 115, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 72} \[ \frac{b^3 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 f (a-b)}+\frac{\left (a^2+a b+b^2\right ) \log (\tan (e+f x))}{a^3 f}+\frac{(a+b) \cot ^2(e+f x)}{2 a^2 f}+\frac{\log (\cos (e+f x))}{f (a-b)}-\frac{\cot ^4(e+f x)}{4 a f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^5/(a + b*Tan[e + f*x]^2),x]

[Out]

((a + b)*Cot[e + f*x]^2)/(2*a^2*f) - Cot[e + f*x]^4/(4*a*f) + Log[Cos[e + f*x]]/((a - b)*f) + ((a^2 + a*b + b^
2)*Log[Tan[e + f*x]])/(a^3*f) + (b^3*Log[a + b*Tan[e + f*x]^2])/(2*a^3*(a - b)*f)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin{align*} \int \frac{\cot ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{x^5 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{x^3 (1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{a x^3}+\frac{-a-b}{a^2 x^2}+\frac{a^2+a b+b^2}{a^3 x}-\frac{1}{(a-b) (1+x)}+\frac{b^4}{a^3 (a-b) (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{(a+b) \cot ^2(e+f x)}{2 a^2 f}-\frac{\cot ^4(e+f x)}{4 a f}+\frac{\log (\cos (e+f x))}{(a-b) f}+\frac{\left (a^2+a b+b^2\right ) \log (\tan (e+f x))}{a^3 f}+\frac{b^3 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 (a-b) f}\\ \end{align*}

Mathematica [A]  time = 0.340275, size = 83, normalized size = 0.72 \[ -\frac{-\frac{b^3 \log \left (a \cot ^2(e+f x)+b\right )}{a^3 (a-b)}-\frac{(a+b) \cot ^2(e+f x)}{a^2}-\frac{2 \log (\sin (e+f x))}{a-b}+\frac{\cot ^4(e+f x)}{2 a}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^5/(a + b*Tan[e + f*x]^2),x]

[Out]

-(-(((a + b)*Cot[e + f*x]^2)/a^2) + Cot[e + f*x]^4/(2*a) - (b^3*Log[b + a*Cot[e + f*x]^2])/(a^3*(a - b)) - (2*
Log[Sin[e + f*x]])/(a - b))/(2*f)

________________________________________________________________________________________

Maple [B]  time = 0.082, size = 264, normalized size = 2.3 \begin{align*} -{\frac{1}{16\,fa \left ( \cos \left ( fx+e \right ) +1 \right ) ^{2}}}+{\frac{7}{16\,fa \left ( \cos \left ( fx+e \right ) +1 \right ) }}+{\frac{b}{4\,f{a}^{2} \left ( \cos \left ( fx+e \right ) +1 \right ) }}+{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) }{2\,fa}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) b}{2\,f{a}^{2}}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ){b}^{2}}{2\,f{a}^{3}}}+{\frac{{b}^{3}\ln \left ( a \left ( \cos \left ( fx+e \right ) \right ) ^{2}- \left ( \cos \left ( fx+e \right ) \right ) ^{2}b+b \right ) }{2\,f{a}^{3} \left ( a-b \right ) }}-{\frac{1}{16\,fa \left ( \cos \left ( fx+e \right ) -1 \right ) ^{2}}}-{\frac{7}{16\,fa \left ( \cos \left ( fx+e \right ) -1 \right ) }}-{\frac{b}{4\,f{a}^{2} \left ( \cos \left ( fx+e \right ) -1 \right ) }}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) }{2\,fa}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) b}{2\,f{a}^{2}}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ){b}^{2}}{2\,f{a}^{3}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^5/(a+b*tan(f*x+e)^2),x)

[Out]

-1/16/f/a/(cos(f*x+e)+1)^2+7/16/f/a/(cos(f*x+e)+1)+1/4/f/a^2/(cos(f*x+e)+1)*b+1/2/f/a*ln(cos(f*x+e)+1)+1/2/f/a
^2*ln(cos(f*x+e)+1)*b+1/2/f/a^3*ln(cos(f*x+e)+1)*b^2+1/2/f*b^3/a^3/(a-b)*ln(a*cos(f*x+e)^2-cos(f*x+e)^2*b+b)-1
/16/f/a/(cos(f*x+e)-1)^2-7/16/f/a/(cos(f*x+e)-1)-1/4/f/a^2/(cos(f*x+e)-1)*b+1/2/f/a*ln(cos(f*x+e)-1)+1/2/f/a^2
*ln(cos(f*x+e)-1)*b+1/2/f/a^3*ln(cos(f*x+e)-1)*b^2

________________________________________________________________________________________

Maxima [A]  time = 1.07262, size = 130, normalized size = 1.13 \begin{align*} \frac{\frac{2 \, b^{3} \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{4} - a^{3} b} + \frac{2 \,{\left (a^{2} + a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2}\right )}{a^{3}} + \frac{2 \,{\left (2 \, a + b\right )} \sin \left (f x + e\right )^{2} - a}{a^{2} \sin \left (f x + e\right )^{4}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/4*(2*b^3*log(-(a - b)*sin(f*x + e)^2 + a)/(a^4 - a^3*b) + 2*(a^2 + a*b + b^2)*log(sin(f*x + e)^2)/a^3 + (2*(
2*a + b)*sin(f*x + e)^2 - a)/(a^2*sin(f*x + e)^4))/f

________________________________________________________________________________________

Fricas [A]  time = 1.32564, size = 367, normalized size = 3.19 \begin{align*} \frac{2 \, b^{3} \log \left (\frac{b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{4} + 2 \,{\left (a^{3} - b^{3}\right )} \log \left (\frac{\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{4} +{\left (3 \, a^{3} - a^{2} b - 2 \, a b^{2}\right )} \tan \left (f x + e\right )^{4} - a^{3} + a^{2} b + 2 \,{\left (a^{3} - a b^{2}\right )} \tan \left (f x + e\right )^{2}}{4 \,{\left (a^{4} - a^{3} b\right )} f \tan \left (f x + e\right )^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/4*(2*b^3*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1))*tan(f*x + e)^4 + 2*(a^3 - b^3)*log(tan(f*x + e)^2/
(tan(f*x + e)^2 + 1))*tan(f*x + e)^4 + (3*a^3 - a^2*b - 2*a*b^2)*tan(f*x + e)^4 - a^3 + a^2*b + 2*(a^3 - a*b^2
)*tan(f*x + e)^2)/((a^4 - a^3*b)*f*tan(f*x + e)^4)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**5/(a+b*tan(f*x+e)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.53353, size = 755, normalized size = 6.57 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

-1/192*(64*(2*a^7 - 2*a^6*b + a^4*b^3 - a^3*b^4)*log(24*a^4)/(a^8 - 2*a^7*b + a^6*b^2) - 32*(2*a^7 - 2*a^6*b +
 a^4*b^3 - a^3*b^4)*log(abs(-12*a^5*cos(f*x + e)^2 + 12*a^4*b*cos(f*x + e)^2 - 12*a^4*b))/(a^8 - 2*a^7*b + a^6
*b^2) + 3*(12*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 8*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x
 + e) - 1)^2/(cos(f*x + e) + 1)^2)/a^2 - 96*(a^2 + a*b + b^2)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/a^3
+ 64*(a^2 + a*b + b^2)*log(abs(a + a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 4*b*(cos(f*x + e) - 1)/(cos(f*x +
 e) + 1) - a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 4*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - a*(co
s(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3))/a^3 + 3*(a^2 + 12*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 8*a*b*(
cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 48*a^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 48*a*b*(cos(f*x + e)
 - 1)^2/(cos(f*x + e) + 1)^2 + 48*b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)*(cos(f*x + e) + 1)^2/(a^3*(co
s(f*x + e) - 1)^2))/f